package tests;

import engine.LeitorDeEngines;
import junit.framework.*;


/**
 * Testa LEXML.
 */
import junit.framework.TestCase;

public class LexmlEngineTest extends TestCase {
	private LeitorDeEngines leitor; 
	private final String Link1 = "http://www.lexml.gov.br/busca/search?f1-tipoDocumento=Legisla%C3%A7%C3%A3o&keyword=aborto";
	private final String Link2 = "http://www.lexml.gov.br/busca/search?f1-tipoDocumento=Legisla%C3%A7%C3%A3o&keyword=processo+12+codigo+civil";
	private final String Link3 = "http://www.lexml.gov.br/busca/search?f1-tipoDocumento=Legisla%C3%A7%C3%A3o&keyword=processo+12+codigo+civil";
	protected void setUp() { 
		leitor = LeitorDeEngines.getInstance();
	} 


	public void testGeracaoDeLinks1() {
		String links;
		links = leitor.pesquisaLexml("aborto", null, null, null, null, null, 
											 null, null, null, null);

		assertEquals("ERRO: Busca Legislacao", Link1, links);




	}
	public void testGeracaoDeLinks2() {
		String links;
		links = leitor.pesquisaLexml("codigo civil", "12", null, null, null, null, 
				 null, null, null, null);

		assertEquals("ERRO: Busca Legislacao", Link2, links);
	}
	
	public void testGeracaoDeLinks3() {
		String links;
		links = leitor.pesquisaLexml("codigo civil", "12", null, null, "Joao Oliveira", null, 
				 null, null, null, null);

		assertEquals("ERRO: Busca Legislacao", Link3, links);
	}
}